﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

public static class ImageHelper
{

	public static IHtmlString Transparent(this HtmlHelper helper, string id, string @class)
	{
		return Transparent(helper, id, @class, true, string.Empty);
	}

	public static IHtmlString Transparent(this HtmlHelper helper, string id, string @class, bool visible, string onclick)
	{
		const string format = "<img id=\"{0}\" class=\"{1}\" src=\"/Images/transparent.gif\" {2} onclick=\"{3}\" />";

		var display = visible ? "" : "style=\"display: none;\"";

		return helper.Raw(string.Format(format, id, @class, display, onclick));
	}

	public static IHtmlString Transparent(this HtmlHelper helper, string id, string @class, string onclick)
	{
		return Transparent(helper, id, @class, true, onclick);
	}
	

}